<template>
  <div>

    <div :style="{height: height + 'px'}" v-if="height"></div>

    <div :style="{ height:statusBarHeight  +  'px'}" class="white-space" v-else-if="statusBar"></div>

    <div :style="{ height:statusBarHeight + 46 +  'px'}" class="white-space" v-else></div>

  </div>
</template>

<script>
  export default {
    name: "white-space",
    props: {
      height: {
        type: Number,
        default: 0
      },
      statusBar: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        statusBarHeight: 0
      }
    },
    created() {
      uni.getSystemInfo({
        success: res => {
          this.statusBarHeight = res.statusBarHeight;
        },
      });
    }
  }
</script>

<style lang="scss" scoped>
  .white-space {
    width: 100vw;
  }
</style>
